package ${package.Mapper};

import ${package.Entity}.${entity};
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;
/**
* ${table.comment!} Mapper 接口
* @author zhangjw
* @since ${cfg.time}
*/
@Mapper
public interface ${table.mapperName} {

List<${entity}> selectList(Map<String, Object> params);

    ${entity} getById(Integer ${cfg.entiName}Id);

    int insert(${entity} ${cfg.entiName});

    void batchInsert(List<${entity}> ${cfg.entiName});

    int update(${entity} ${cfg.entiName});

    void deleteById(Integer ${cfg.entiName}Id);

    void deleteByIds(Integer[] ${cfg.entiName}Ids);

    ${entity} checkExists(${entity} ${cfg.entiName});
}
private void check${entity}(${entity} ${cfg.entiName}) {
    if(${cfg.entiName}Mapper.checkExists(${cfg.entiName})!=null){
        throw new CustomException("名称已经存在:"+${cfg.entiName}.get${cfg.nameCapitalName}());
    }
}